package kr.ac.skhu.m.mapper;

import java.sql.ResultSet;
import java.sql.SQLException;

import kr.ac.skhu.m.domain.Used;

import org.springframework.jdbc.core.RowMapper;

public class UsedM implements RowMapper {

	@Override
	public Object mapRow(ResultSet rs, int rowNum) throws SQLException {
		
		Used usedDomain = new Used();
		
		usedDomain.setArticleNo(rs.getString("article_no"));
		usedDomain.setBoardNo(rs.getInt("board_no"));
		usedDomain.setComment(rs.getString("comment"));
		usedDomain.setGoodsName(rs.getString("goods_name"));
		usedDomain.setPrice(rs.getInt("price"));
		usedDomain.setRegDate(rs.getTimestamp("reg_date"));
		usedDomain.setTitle(rs.getString("title"));
		usedDomain.setType(rs.getInt("type"));
		usedDomain.setWriter(rs.getString("writer"));
		usedDomain.setPassword(rs.getString("password"));
		
		return usedDomain;
	}
	
}
